import Main from '@/components/main'
// import parentView from '@/components/parent-view'
// import systemRouter from './group/system'
// import systemSetupRouter from './group/system-setup'

/**
 * iview-admin中meta除了原生参数外可配置的参数:
 * meta: {
 *  title: { String|Number|Function }
 *         显示在侧边栏、面包屑和标签栏的文字
 *         使用'{{ 多语言字段 }}'形式结合多语言使用，例子看多语言的路由配置;
 *         可以传入一个回调函数，参数是当前路由对象，例子看动态路由和带参路由
 *  hideInBread: (false) 设为true后此级路由将不会出现在面包屑中，示例看QQ群路由配置
 *  hideInMenu: (false) 设为true后在左侧菜单不会显示该页面选项
 *  notCache: (false) 设为true后页面在切换标签后不会缓存，如果需要缓存，无需设置这个字段，而且需要设置页面组件name属性和路由配置的name一致
 *  access: (null) 可访问该页面的权限数组，当前路由设置的权限会影响子路由
 *  icon: (-) 该页面在左侧菜单、面包屑和标签导航处显示的图标，如果是自定义图标，需要在图标名称前加下划线'_'
 *  beforeCloseName: (-) 设置该字段，则在关闭当前tab页时会去'@/router/before-close.js'里寻找该字段名对应的方法，作为关闭前的钩子函数
 * }
 */

const base = [
  {
    path: '/login',
    name: 'login',
    meta: {
      title: 'Login - 登录',
      hideInMenu: true
    },
    component: () => import('@/view/login/login.vue')
  },
  {
    path: '/indexv3',
    name: 'indexv3',
    redirect: '/indexv3',
    meta: {
      title: '首页v3',
      hideInMenu: true,
      hide: false,
      hideInBread: false
    },
    component: () => import('@/view/xian-page/indexv3/index.vue'),
    children: [
      {
        path: '/mainv3',
        name: 'mainv3',
        meta: {
          title: '首页',
          icon: 'md-home',
          notCache: true,
          hide: true
        },
        component: () => import('@/view/xian-page/mainv3/index.vue')
      },
      {
        path: '/gridnew',
        name: 'gridnew',
        meta: {
          title: '网格一张图',
          icon: 'md-home',
          hide: true
        },
        component: () => import('@/view/xian-page/grid-new/index.vue')
      }, {
        path: '/grid-createxq',
        name: 'grid-createxq',
        meta: {
          title: '添加小区',
          icon: 'md-home',
          hide: true
        },
        component: () => import('@/view/xian-page/grid-createxq/index.vue')
      }, {
        path: '/grid-foucsgroup',
        name: 'grid-foucsgroup',
        meta: {
          title: '标签管理',
          icon: 'md-home',
          hide: true
        },
        component: () => import('@/view/xian-page/focus-group/index.vue')
      }, {
        path: '/grid-module',
        name: 'grid-module',
        meta: {
          title: '模块管理',
          icon: 'md-home',
          hide: true
        },
        component: () => import('@/view/xian-page/grid-module/index.vue')
      }, {
        path: '/grid-type',
        name: 'grid-type',
        meta: {
          title: '模块管理',
          icon: 'md-home',
          hide: true
        },
        component: () => import('@/view/xian-page/grid-type/index.vue')
      }, {
        path: '/managerTree',
        name: 'managerTree',
        meta: {
          title: '管理员列表',
          icon: 'md-home',
          hide: true
        },
        component: () => import('@/view/xian-page/managerTree/index.vue')
      },
      {
        path: '/personnel-info',
        name: 'personnel-info',
        meta: {
          title: '人员标签列表',
          icon: 'md-home',
          hide: true
        },
        component: () => import('@/view/xian-page/personnel-info/index.vue')
      },
      {
        path: '/gridselectnew',
        name: 'gridselectnew',
        meta: {
          title: '网格一张图',
          icon: 'md-home',
          hide: true
        },
        component: () => import('@/view/xian-page/grid-select-new/index.vue')
      },
      {
        path: '/resource-map',
        name: 'resource-map',
        meta: {
          title: '资源图标签管理',
          icon: 'md-home',
          hide: true
        },
        component: () => import('@/view/xian-page/resource-map/index.vue')
      }, {
        path: '/itemlist',
        name: 'itemlist',
        meta: {
          title: '办理渠道',
          icon: 'md-home',
          hide: true
        },
        component: () => import('@/view/xian-page/item-list/index.vue')
      }, {
        path: '/jxlist',
        name: 'jxlist',
        meta: {
          title: '绩效',
          icon: 'md-home',
          hide: true
        },
        component: () => import('@/view/xian-page/jixiao-list/index.vue')
      },
      {
        path: '/hot-map',
        name: 'hot-map',
        meta: {
          title: '热力图',
          icon: 'md-home',
          hide: true
        },
        component: () => import('@/view/xian-page/hot-map/index.vue')
      }, {
        path: '/publist',
        name: 'publist',
        meta: {
          title: '列表',
          icon: 'md-home',
          hide: true
        },
        component: () => import('@/view/xian-page/pub-list/index.vue')
      }, {
        path: '/grid',
        name: 'grid',
        meta: {
          title: '网格一张图',
          icon: 'md-home',
          hide: true
        },
        component: () => import('@/view/xian-page/grid/index.vue')
      },
      {
        path: '/someuser',
        name: 'someuser',
        meta: {
          title: '网格人员信息管理',
          icon: 'md-home',
          hide: true,
          notCache: true
        },
        component: () => import('@/view/xian-page/someuser/someuserlist/index.vue')
      },
      {
        path: '/resourcelist',
        name: 'resourcelist',
        meta: {
          title: '资源图',
          icon: 'md-home',
          hide: true,
          notCache: true
        },
        component: () => import('@/view/xian-page/grid-resource-list/someuserlist/index.vue')
      },
      {
        path: '/focuspeoplelist',
        name: 'focuspeoplelist',
        meta: {
          title: '重点人群',
          icon: 'md-home',
          hide: true
        },
        component: () => import('@/view/xian-page/focuspeoplelist/index.vue')
      },
      {
        path: '/visitpeoplelist',
        name: 'visitpeoplelist',
        meta: {
          title: '走访人群',
          icon: 'md-home',
          hide: true
        },
        component: () => import('@/view/xian-page/visitpeoplelist/index.vue')
      },
      {
        path: '/disputespeoplelist',
        name: 'disputespeoplelist',
        meta: {
          title: '纠纷人群',
          icon: 'md-home',
          hide: true
        },
        component: () => import('@/view/xian-page/disputespeoplelist/index.vue')
      },
      {
        path: '/gridmaintain',
        name: 'gridmaintain',
        meta: {
          title: '网格-管理',
          icon: 'md-home',
          hide: true
        },
        component: () => import('@/view/xian-page/grid-maintain/index.vue')
      },
      {
        path: '/gridmaintainnew',
        name: 'gridmaintainnew',
        meta: {
          title: '网格信息维护',
          icon: 'md-home',
          hide: true,
          notCache: true
        },
        component: () => import('@/view/xian-page/grid-maintain-new/index.vue')
      },
      {
        path: '/heatmap',
        name: 'heatmap',
        meta: {
          title: '热力图分布',
          icon: 'md-home',
          hide: true
        },
        component: () => import('@/view/xian-page/heatmap/index.vue')
      },
      {
        path: '/sys/user-manager',
        name: 'sysUserManager',
        meta: {
          title: '用户管理'
        },
        component: () => import('@/view/system/user-manager')
      }, {
        path: '/sys/company-manager',
        name: 'sysCompanyManager',
        meta: {
          title: '机构管理'
        },
        component: () => import('@/view/system/company-manager')
      }, {
        path: '/sys/role-manager',
        name: 'sysRoleManager',
        meta: {
          title: '角色管理'
        },
        component: () => import('@/view/system/role-manager')
      }, {
        path: '/sys/menu-manager',
        name: 'sysMenuManager',
        meta: {
          title: '菜单管理'
        },
        component: () => import('@/view/system/menu-manager')
      },
      {
        path: '/sys/dict-manager',
        name: 'sysDictManager',
        meta: {
          title: '字典管理'
        },
        component: () => import('@/view/system/dict-list')
      },
      {
        path: '/sys/update-password',
        name: 'sysUpdatePassword',
        meta: {
          title: '修改密码'
        },
        component: () => import('@/view/system/update-password')
      },
      {
        path: '/sys/sync-list',
        name: 'sysSyncList',
        meta: {
          title: '同步列表'
        },
        component: () => import('@/view/system/sync-list')
      },
      {
        path: '/sys/port-list',
        name: 'sysPortList',
        meta: {
          title: '接口列表'
        },
        component: () => import('@/view/system/port-list')
      },
      {
        path: '/sys/user-port-list',
        name: 'sysUserPortList',
        meta: {
          title: '用户侧接口'
        },
        component: () => import('@/view/system/user-port-list')
      },
      {
        path: '/sys/log-api-list',
        name: 'sysLogApiList',
        meta: {
          title: 'Api日志列表'
        },
        component: () => import('@/view/system/log-api-list')
      },
      {
        path: '/sys/api-category',
        name: 'sysApiCategory',
        meta: {
          title: 'Api分类'
        },
        component: () => import('@/view/system/api-category')
      },
      {
        path: '/sys/staff-manager',
        name: 'sysStaffManager',
        meta: {
          title: '员工管理'
        },
        component: () => import('@/view/system/staff-manager')
      },
      {
        path: '/sys/staff-role-manager',
        name: 'sysStaffRoleManager',
        meta: {
          title: '员工角色管理'
        },
        component: () => import('@/view/system/staff-role-manager')
      },
      {
        path: '/sys/area-list',
        name: 'sysAreaList',
        meta: {
          title: '区域列表'
        },
        component: () => import('@/view/system/area-list')
      }
    ]
  },
  {
    path: '/',
    name: '_home',
    redirect: '/gridselectnew',
    component: Main,
    meta: {
      hideInMenu: true,
      notCache: true
    }
  },
  {
    path: '/error_store',
    name: 'error_store',
    meta: {
      hideInBread: true
    },
    component: Main,
    children: [
      {
        path: 'error_store_page',
        name: 'error_store_page',
        meta: {
          icon: 'ios-bug',
          title: '错误收集'
        },
        component: () => import('@/view/error-store/error-store.vue')
      }
    ]
  },
  {
    path: '/401',
    name: 'error_401',
    meta: {
      hideInMenu: true
    },
    component: () => import('@/view/error-page/401.vue')
  },
  {
    path: '/500',
    name: 'error_500',
    meta: {
      hideInMenu: true
    },
    component: () => import('@/view/error-page/500.vue')
  },
  {
    path: '*',
    name: 'error_404',
    meta: {
      hideInMenu: true
    },
    component: () => import('@/view/error-page/404.vue')
  }
]
// base[3].children.push.apply(base[3].children, systemRouter)
// base[3].children.push.apply(base[3].children, systemSetupRouter)
export default base
